package com.yaner.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yaner.dao.UserDao;
import com.yaner.service.IUserService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements IUserService {
    private final UserDao userDao;
    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }

    @DS("master")
    @Override
    public List selectMaster(){
        return  userDao.selectList(new QueryWrapper<>());
    }


    @DS("slave_1")
    @Override
    public List selectSlave(){
        return  userDao.selectList(new QueryWrapper<>());
    }

    @DS("slave_2")
    @Override
    public List selectSlave2(){
        return  userDao.selectList(new QueryWrapper<>());
    }

}
